function remSize() {
    var deviceWidth = document.documentElement.clientWidth || window.innerWidth;
    if (deviceWidth >= 750) {
        deviceWidth = 750;
        console.log("enter");
    }
    if (deviceWidth <= 320) {
        deviceWidth = 320;
    }
    document.documentElement.style.fontSize = (deviceWidth / 7.5) + 'px';
    document.body.style.fontSize = 0.3 + 'rem'
    console.log(deviceWidth);
}

window.onresize = function () {
    remSize();
}
remSize();